package com.mind.core.db;

import com.bugull.mongo.annotations.Id;
import com.bugull.mongo.annotations.IdType;
import com.mind.db.IEntity;
import com.mind.db.async.AsyncUpdateManager;

public class BaseEntity implements IEntity{
	@Id(type=IdType.USER_DEFINE)
	private String id;
	@Override
	public void setId(String id) {
		this.id=id;
	}
	@Override
	public String getId() {
		return id;
	}
	/**
	 * @param entity
	 */
	public void update(){
		AsyncUpdateManager.getInstance().update(this);
	}
	public void insert(){
		AsyncUpdateManager.getInstance().create(this);
	}
}
